package org.jeecg.modules.door.service.impl;

import org.jeecg.modules.door.entity.LwgyEglockGroupright;
import org.jeecg.modules.door.entity.LwgyEglockGrouprightuser;
import org.jeecg.modules.door.entity.LwgyEglockGrouprightlock;
import org.jeecg.modules.door.mapper.LwgyEglockGrouprightuserMapper;
import org.jeecg.modules.door.mapper.LwgyEglockGrouprightlockMapper;
import org.jeecg.modules.door.mapper.LwgyEglockGrouprightMapper;
import org.jeecg.modules.door.service.ILwgyEglockGrouprightService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import java.io.Serializable;
import java.util.List;
import java.util.Collection;

/**
 * @Description: 门锁分组管理
 * @Author: jeecg-boot
 * @Date:   2022-06-15
 * @Version: V1.0
 */
@Service
public class LwgyEglockGrouprightServiceImpl extends ServiceImpl<LwgyEglockGrouprightMapper, LwgyEglockGroupright> implements ILwgyEglockGrouprightService {

	@Autowired
	private LwgyEglockGrouprightMapper lwgyEglockGrouprightMapper;
	@Autowired
	private LwgyEglockGrouprightuserMapper lwgyEglockGrouprightuserMapper;
	@Autowired
	private LwgyEglockGrouprightlockMapper lwgyEglockGrouprightlockMapper;
	
	@Override
	@Transactional
	public void delMain(String id) {
		lwgyEglockGrouprightuserMapper.deleteByMainId(id);
		lwgyEglockGrouprightlockMapper.deleteByMainId(id);
		lwgyEglockGrouprightMapper.deleteById(id);
	}

	@Override
	@Transactional
	public void delBatchMain(Collection<? extends Serializable> idList) {
		for(Serializable id:idList) {
			lwgyEglockGrouprightuserMapper.deleteByMainId(id.toString());
			lwgyEglockGrouprightlockMapper.deleteByMainId(id.toString());
			lwgyEglockGrouprightMapper.deleteById(id);
		}
	}
	
}
